package com.xxx.borrow.model.utils;

/**
 * 字符串工具类
 */
public class StringUtil {

    /**
     * 手机号脱敏
     */
    public static String getPhoneCode(String phone) {
        if (phone != null && phone.trim().length() == 11) {
            StringBuilder sb = new StringBuilder(phone.trim());
            sb.replace(3, 7, "****");
            return sb.toString();
        }
        return phone;
    }

}
